package com.atguigu.contacts;

import java.util.Arrays;
import java.util.Scanner;

public class personClass2 {
	public static void main(String[] args) {
		Person2 p = new Person2();
		p.age = 12;
		p.sex = 1;
		p.name = "张三";
		p.study();
		int age = p.addAge(5);
		System.out.println("age:" + age);
		
	}
}
class Person2 {
	String name;
	int age;
	int sex;
	public void study () {
		System.out.println("我爱学习");
	}
	public void showAge () {
		System.out.println("我几年" + this.age + "岁了");
	}
	public int addAge (int i) {
		return this.age + i;
	}
}
